package com.ruoyi.veterinary.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.veterinary.mapper.VetCustomerMapper;
import com.ruoyi.veterinary.domain.VetCustomer;
import com.ruoyi.veterinary.service.IVetCustomerService;

/**
 * 客户信息Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-01-19
 */
@Service
public class VetCustomerServiceImpl implements IVetCustomerService 
{
    @Autowired
    private VetCustomerMapper vetCustomerMapper;

    /**
     * 查询客户信息
     * 
     * @param customerId 客户信息主键
     * @return 客户信息
     */
    @Override
    public VetCustomer selectVetCustomerByCustomerId(Long customerId)
    {
        return vetCustomerMapper.selectVetCustomerByCustomerId(customerId);
    }

    /**
     * 查询客户信息列表
     * 
     * @param vetCustomer 客户信息
     * @return 客户信息
     */
    @Override
    public List<VetCustomer> selectVetCustomerList(VetCustomer vetCustomer)
    {
        return vetCustomerMapper.selectVetCustomerList(vetCustomer);
    }

    /**
     * 新增客户信息
     * 
     * @param vetCustomer 客户信息
     * @return 结果
     */
    @Override
    public int insertVetCustomer(VetCustomer vetCustomer)
    {
        vetCustomer.setCreateTime(DateUtils.getNowDate());
        return vetCustomerMapper.insertVetCustomer(vetCustomer);
    }

    /**
     * 修改客户信息
     * 
     * @param vetCustomer 客户信息
     * @return 结果
     */
    @Override
    public int updateVetCustomer(VetCustomer vetCustomer)
    {
        vetCustomer.setUpdateTime(DateUtils.getNowDate());
        return vetCustomerMapper.updateVetCustomer(vetCustomer);
    }

    /**
     * 批量删除客户信息
     * 
     * @param customerIds 需要删除的客户信息主键
     * @return 结果
     */
    @Override
    public int deleteVetCustomerByCustomerIds(Long[] customerIds)
    {
        return vetCustomerMapper.deleteVetCustomerByCustomerIds(customerIds);
    }

    /**
     * 删除客户信息信息
     * 
     * @param customerId 客户信息主键
     * @return 结果
     */
    @Override
    public int deleteVetCustomerByCustomerId(Long customerId)
    {
        return vetCustomerMapper.deleteVetCustomerByCustomerId(customerId);
    }

    /**
     * 根据客户名称模糊查询客户列表
     * 
     * @param customerName 客户名称
     * @return 客户信息集合
     */
    @Override
    public List<VetCustomer> selectVetCustomerByName(String customerName)
    {
        return vetCustomerMapper.selectVetCustomerByName(customerName);
    }
}